<template>
	<view class="content">
		<view class="item" v-for="item in list">
			<image :src="item.user.avatarUrl" mode="" v-if="item.user"></image>
			<view class="name"  v-if="item.user">
				{{item.user.name}}
			</view>
			<view class="">
				{{item.create_time}}
			</view>
		</view>
		<view class="nidata" v-if="list.length==0">
			<image src="../../static/images/noimg.png"></image>
		</view>
	</view>
	
</template>

<script>
	export default{
		data(){
			return{
				type:'',
				page:1,
				last_page:'',
				list:[]
			}
		},
		onLoad(e) {
			this.type=e.type
			this.getlist()
		},
		onReachBottom() {
			this.page++
			if (this.last_page > this.page) {
			  this.getinit()
			}
		},
		methods:{
			getlist(){
				this.request('/api/member.space/getAppointmentList',{
					specialarea_type:this.type,
					page:this.page,
					page_size:10
					}).then(res => {
					if(res.data.code==1){
						this.list = this.list.concat(res.data.data.list)
						this.last_page = res.data.data.last_page
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.item{
		margin: 20rpx;
	  display: grid;
		grid-template-columns: 100rpx auto 300rpx;
		view{
			font-size: 26rpx;
			color: #8c8c8c;
			line-height: 80rpx;
		}

		image{
			width: 80rpx;
			height: 80rpx;
			border-radius: 50%;
			margin-right: 20rpx;
		}
	}
</style>